﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"
        type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
    <script src=""></script>
    <title>Sandbox</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <style type="text/css" media="screen">
        body
        {
            background-color: #FFF;
            font: 16px Helvetica, Arial;
            color: #000;
        }
        label
        {
            margin: 5px 5px 0 10px;
        }
        h2
        {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <script type="text/jscript">
        $(function () {
            $('#table').click(function () {

                $('<table>')
    .append('<thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead>')
    .append('<tbody><tr><td>Cell 1</td><td><input type="text" /></td><td>Cell 3</td></tr><tr><td><input type="text" /></td><td>Cell 5</td><td><input type="text" /></td></tr></tbody>').insertAfter(this);
                $('<input type="text" />').insertAfter(this);

            });


            $('#datePicker').click(function () {
                $('input:text').datepicker(
    {
        showOn: "both",
        dateFormat: "dd M yy",
        firstDay: 1,
        changeFirstDay: false
    });
            });

        });

    </script>
    <h2>
        Example of attaching jQuery Datepicker to inserted text inputs</h2>
    <button id="table">
        Generate table</button>
    <br />
    <button id="datePicker">
        Attach datepicker</button>
</body>
</html>
